<m-card>
  <ng-container card-head>
    <div class="d-flex align-items-center">
      <div class="g-card-title">定制权限 -- 步骤{{ current + 1 }}：{{ steps[current].title }}</div>
    </div>
  </ng-container>
  <div class="row">
    <div class="col-md-4 col-xl-3  border-right">
      <m-wizard-stepper
        [dataSource]="steps"
        [(value)]="current"
        [(child)]="child"
        (childChange)="childChange($event)"
      >
      </m-wizard-stepper>
    </div>
    <div class="col-md-8 col-xl-9 pl-0">
      <div class="router-outlet">
        <perfect-scrollbar class="flex-full p-3" (psScrollY)="scroll()">
          <form #form [formGroup]="formGroup" [ngSwitch]="current">
            <m-select-personnel *ngSwitchCase="0" formGroupName="user"></m-select-personnel>
            <m-select-computer *ngSwitchCase="1" formGroupName="pc"></m-select-computer>
            <m-config *ngSwitchCase="2" formGroupName="pc_config"></m-config>
            <m-select-software *ngSwitchCase="3" formGroupName="software"></m-select-software>
          </form>
        </perfect-scrollbar>
        <div class="step-button-group border-top p-3 ">
          <div>
            <button class="btn btn-secondary" (click)="current = current - 1" *ngIf="current">
              上一步
            </button>
          </div>
          <div>
            <button
              class="btn btn-primary"
              (click)="current = current + 1"
              *ngIf="current < steps.length - 1; else saveRef"
            >
              下一步
            </button>
            <ng-template #saveRef>
              <!-- <button
                #saveBtnRef
                class="btn btn-primary"
                [disabled]="steps[0].invalid || steps[1].invalid"
                (click)="submit()"
                appNoDblClick
              >
                保存
              </button> -->
              <button
                #saveBtnRef
                class="btn btn-primary"
                [disabled]="steps[0].invalid"
                (click)="submit()"
                appNoDblClick
              >
                保存
              </button>
            </ng-template>
          </div>
        </div>
      </div>
    </div>
  </div>
</m-card>
